package com.crud.generator.template;

import com.crud.generator.model.ColumnMetadata;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Collections;
import java.util.List;

/**
 * 通用模板上下文，替代原有Map结构。
 */
@Getter
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class TemplateContext {

    private String packageName;

    private String className;

    private String lowerClassName;

    private String author;

    private String projectName;

    private String projectDescription;

    private String projectCode;

    private String projectClassName;

    private String projectDbName;

    private boolean enableRedis;

    private boolean enableSecurity;

    private String cacheName;

    private String securityRole;

    private String securityDefaultTenant;

    private String securityDefaultUsername;

    private String securityDefaultPassword;

    private String securityTokenHeader;

    private String securityTokenPrefix;

    private String securityTenantHeader;

    private String jwtSecret;

    private long jwtExpirationSeconds;

    private long jwtRefreshExpirationSeconds;

    private boolean hasAuditFields;

    private boolean hasSoftDeleteField;

    private String createdTimeField;

    private String updatedTimeField;

    private String createdByField;

    private String updatedByField;

    private String deletedFlagField;

    private boolean hasTenantColumn;

    private String tenantField;

    private String tenantColumn;

    private String tableName;

    private String tableComment;

    @Builder.Default
    private List<ColumnMetadata> columns = Collections.emptyList();

    @Builder.Default
    private List<ColumnMetadata> primaryKeys = Collections.emptyList();

    private String primaryKeyField;

    private String primaryKeyProperty;

    private String primaryKeyType;

    private String primaryKeyColumn;

    private boolean hasSinglePrimaryKey;

    private boolean hasCompositePrimaryKey;

    private boolean hasDateType;

    private boolean hasBigDecimal;

    private String originalSql;
}
